PrintPRO 8 for ActiveX - User Guide > How To > Set Up Printer > Set Printer Coordinates |
The printer coordinate system is based on the physical dimensions of the paper in the printer. The horizontal and vertical starting position (0,0) is located at the upper left corner of the paper. Printer units are defined by the ScaleMode property. The default ScaleMode is twips. If the printer has 8½ x 11in. paper and the orientation of the paper is portrait, the width of the printer is 12240 twips and the height is 15840 twips. You can get the physical height and width of the printer using the PHeight and PWidth properties.
A printer also has a display area. The display area is located inside the physical area. The ScaleWidth and ScaleHeight properties can be used to get width and height of the display area. The DisplayX and DisplayY properties can be used to get the coordinates of the upper left corner of the display area.
The resolution of a printer is measured in dots per inch. You can get the horizontal and vertical resolution of a printer using the ResX and ResY properties.
There are times when you might need to know the number of twips per printer dot (or pixel). The TwipsPerPixelX and TwipsPerPixelY properties can be used to get the printers horizontal or vertical twips per pixel.
The PrintPRO control maintains internal coordinates that are used, and updated, by some of the text, graphics and bitmap methods. The CurrentX property can be used to get or set the internal horizontal coordinate. The CurrentY property can be used to get or set the internal vertical coordinate. For example, if the CurrentX and CurrentY properties are set to 1440 twips, the following code will print Hello World one inch from the top and left side of the paper since the PrintText method uses the CurrentX and CurrentY values to position the text.
Example |
Copy Code
|
---|---|
PrintPRO1.CurrentX = 1440
PrintPRO1.CurrentY = 1440
PrintPRO1.PrintText "Hello World"
|